<script setup lang="ts">
import { ref } from 'vue'
let childMoney = ref(100)
defineExpose({
  childMoney
})

const getParent = ($parent: any) => {
  console.log('父组件实例', $parent)
  console.log('父组件实例中暴露的变量(不需.value)', $parent.parentMoney)
}
</script>

<template>
  <button @click="getParent($parent)">获取父组件实例</button>
</template>

<style scoped></style>
